//package com.plian.system.controller.pf;
//
//import com.plian.Tools.Func;
//import com.plian.Tools.StringPool;
//import com.plian.Tools.base.BaseController;
//import com.plian.Tools.pagedata.PageData;
//import com.plian.system.config.Resubmit;
//import com.plian.system.dto.pf.BaseExpenditureImplementationDTO;
//import com.plian.system.entity.pf.BaseExpenditureImplementation;
//import com.plian.system.model.CommonCode;
//import com.plian.system.model.ListResult;
//import com.plian.system.model.R;
//import com.plian.system.mybatis.support.Query;
//import com.plian.system.service.pf.IBaseExpenditureImplementationService;
//import com.plian.system.service.wf.FormWorkflowService;
//import com.plian.system.vo.pf.BaseExpenditureImplementationVO;
//import com.plian.system.vo.pf.ExpenditureOrgVO;
//import com.plian.system.vo.report.ReportReturnVO;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import lombok.AllArgsConstructor;
//import org.apache.commons.lang3.StringUtils;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import javax.validation.Valid;
//import java.util.HashMap;
//import java.util.List;
//
///**
// * @Description: TODO
// * @Author: Take-off
// * @Date: 2023/3/13 9:39 PM
// * @Param
// * @return
// * @Version: 1.0
// **/
//@RestController
//@AllArgsConstructor
//@RequestMapping("api/enterpriseimplementation")
//@Api(value = "BaseExpenditureImplementationController", tags = "履职待遇、业务支出执行情况 控制器")
//public class BaseExpenditureImplementationController extends BaseController {
//
//    private FormWorkflowService formWorkflowService;
//
//    private IBaseExpenditureImplementationService expenditureImplementationService;
//
//    @PostMapping("/detail")
//    @ApiOperation(value = "详情", notes = "传入 expenditureImplementation")
//    public R<BaseExpenditureImplementationVO> detail(@RequestBody BaseExpenditureImplementation expenditureImplementation) {
//        return expenditureImplementationService.getDetailObj(expenditureImplementation);
//    }
//
//    @PostMapping("/list")
//    @ApiOperation(value = "分页", notes = "传入query")
//    public ListResult<BaseExpenditureImplementationVO> list(@RequestBody Query query) {
//        return expenditureImplementationService.list(query);
//    }
//
//    @PostMapping("/submit")
//    @Resubmit(delaySeconds = 0)
//    @ApiOperation(value = "新增或修改", notes = "传入 expenditureImplementation")
//    public R<BaseExpenditureImplementation> submit(@Valid @RequestBody BaseExpenditureImplementation expenditureImplementation) {
//        boolean result = expenditureImplementationService.submit(expenditureImplementation);
//        HashMap<String, Object> processVariable = new HashMap<>();
//        formWorkflowService.startProcessAndSimulate(String.valueOf(expenditureImplementation.getId()),expenditureImplementation.getFormType(),processVariable);
//        return result ? R.data(expenditureImplementation) : new R(CommonCode.FAIL);
//    }
//
//    @PostMapping("/remove")
//    @ApiOperation(value = "删除", notes = "传入 ids")
//    public R remove(@RequestBody PageData pd) {
//        List<String> ids = (List<String>)pd.get("ids");
//        return expenditureImplementationService.deleteLogic(Func.toLongList(StringUtils.join(ids, StringPool.COMMA)))
//                ? new R(CommonCode.SUCCESS) : new R(CommonCode.FAIL);
//    }
//
//    @PostMapping("/lastDetail")
//    @ApiOperation(value = "获取最新数据", notes = "传入 fillingUnitId,执行年月")
//    public R<BaseExpenditureImplementationVO> getLastDetailObj(@RequestBody BaseExpenditureImplementationDTO dto) {
//        return expenditureImplementationService.getLastDetailObj(dto);
//    }
//
//    @PostMapping("/report")
//    @ApiOperation(value = "报表", notes = "传入 年份")
//    public R<ReportReturnVO> report(@RequestBody BaseExpenditureImplementationDTO dto) {
//        return R.data(expenditureImplementationService.report(dto));
//    }
//
//    @PostMapping("/daraSummary")
//    @ApiOperation(value = "数据汇总", notes = "传入 fillingUnitId-组织Id,executionMonth- 执行年月")
//    public R<List<ExpenditureOrgVO>> getDataSummary( @RequestBody BaseExpenditureImplementationDTO dto) {
//        return R.data(expenditureImplementationService.getDataSummary(dto.getExecutionMonth(),dto.getFillingUnitId()));
//    }
//
//    @PostMapping("/treeList")
//    @ApiOperation(value = "树形列表", notes = "传入 query")
//    public ListResult<BaseExpenditureImplementationVO> treeList(@RequestBody Query query) {
//        return expenditureImplementationService.treeList(query);
//    }
//
//    @PostMapping("/sumValue")
//    @ApiOperation(value = "返回本月子企业数据汇总值", notes = "传入 orgIds-组织Id,executionMonth- 执行年月")
//    public R<BaseExpenditureImplementationVO> addSumValue(@RequestBody BaseExpenditureImplementationDTO dto) {
//        return R.data(expenditureImplementationService.addSumValue(dto.getOrgIds(),dto.getExecutionMonth()));
//    }
//
//    @PostMapping("/initialization")
//    @ApiOperation(value = "新增-初始化", notes = "传入 executionMonth- 执行年月")
//    public R<BaseExpenditureImplementationVO> initialization(@RequestBody BaseExpenditureImplementationVO vo) {
//        return R.data(expenditureImplementationService.initialization(vo));
//    }
//}
